<script>
	export default {
		async onLaunch(options) {
			// this.$store.dispatch('getUserInfo')
			this.$scope.globalData.pxRatio=750/uni.getSystemInfoSync().windowWidth
			console.log(options)
		},
		onShow: function(options) {
			this.$store.dispatch('getUserInfo',{loading:false})
			let {query,scene}=options
			let referCode=query.refer_code
			if(referCode){
				this.$api.bindFriend({refer_code:referCode})
			}
			if(query.scene){
				this.$api.decodeScene({scene:query.scene}).then(res=>{
					if(res.content&&res.content.refer_code){
						this.$api.bindFriend({refer_code:res.content.refer_code})
					}
					if(res.page){
						uni.reLaunch({
							url:res.page
						})
					}
				})
			}
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData:{
			pxRatio:2
		}
	}
</script>

<style lang="scss">
	page{
		color:#333;
		height: 100%;
	}
	/*每个页面公共css */
	view,
	scroll-view,
	swiper,
	swiper-item,
	cover-view,
	cover-image,
	icon,
	text,
	rich-text,
	progress,
	button,
	checkbox,
	form,
	input,
	label,
	radio,
	slider,
	switch,
	textarea,
	navigator,
	audio,
	camera,
	image,
	video {
		box-sizing: border-box;
	}
	rich-text{
		display: block;
	}
	@font-face {
		font-family: 'iconfont';
		src: url('~@/static/iconfont.ttf') format('truetype');
	}
	.iconfont{
		font-family: iconfont !important;
		font-size: 32rpx;
		font-style: normal;
		font-weight: normal;
		line-height: 1;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}
	
	.icon-wenhao:before {
	  content: "\e65b";
	}
	
	.icon-copy:before {
	  content: "\e65a";
	}
	
	.icon-add-bg:before {
	  content: "\e762";
	}
	
	.icon-wechat:before {
	  content: "\e62d";
	}

	.icon-yuan:before {
	  content: "\e63a";
	}
	
	.icon-female:before {
	  content: "\e649";
	}
	
	.icon-male:before {
	  content: "\e669";
	}
	
	.icon-close1:before {
	  content: "\e619";
	}
	
	.icon-close:before {
	  content: "\e65d";
	}
	
	.icon-right:before {
	  content: "\e6dd";
	}
	
	.icon-correct:before {
	  content: "\e617";
	}
	
	.icon-heart:before {
	  content: "\e65f";
	}
	
	.icon-edit:before {
	  content: "\e627";
	}
	
	.icon-male{
		color:#5D98F2;
	}
	.icon-female{
		color:#F48E96;
	}
	.icon-heart{
		color:#E7404A;
		font-weight: normal;
	}
	.text-ellipsis-1{
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
	.text-ellipsis-2{
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
		-webkit-line-clamp:2;
	}
	.text-ellipsis-3{
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
		-webkit-line-clamp:3;
	}
	
	.wish-btn{
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 36rpx;
		height: 90rpx;
		color:#fff;
		background-color: #E7404A;
		border-radius: 10rpx;
		&.disabled{
			background-color: #999;
		}
	}
	
	.line-through{
		text-decoration: line-through;
	}
	
	.red{
		color:#E7404A;
	}
	
	.yellow{
		color:#F8E71C;
	}
	
	page {  
	    --safe-area-inset-top: 0px;  
	    --safe-area-inset-right: 0px;  
	    --safe-area-inset-bottom: 0px;  
	    --safe-area-inset-left: 0px;  
	
	}  
	
	@supports (top: constant(safe-area-inset-top)) {  
	    page {  
	        --safe-area-inset-top: constant(safe-area-inset-top);  
	        --safe-area-inset-right: constant(safe-area-inset-right);  
	        --safe-area-inset-bottom: constant(safe-area-inset-bottom);  
	        --safe-area-inset-left: constant(safe-area-inset-left);  
	    }  
	
	}  
	
	@supports (top: env(safe-area-inset-top)) {  
	    page {  
	        --safe-area-inset-top: env(safe-area-inset-top);  
	        --safe-area-inset-right: env(safe-area-inset-right);  
	        --safe-area-inset-bottom: env(safe-area-inset-bottom);  
	        --safe-area-inset-left: env(safe-area-inset-left);  
	    }  
	} 
</style>
